import request from "@/plugins/request";

var pre = "/visitorscardapp";

if (process.env.NODE_ENV !== "development") {
  pre = "/api/sa/conv-access" + pre;
}


// 新增门禁卡信息
export function add(data) {
  return request({
    url: `${pre}/add`,
    method: "post",
    data,
  });
}

// 删除门禁卡信息
export function del(data) {
  return request({
    url: `${pre}/del`,
    method: "post",
    data,
  });
}

// 修改门禁卡信息
export function edit(data) {
  return request({
    url: `${pre}/edit`,
    method: "post",
    data,
  });
}


// 门禁卡信息回显
export function getById(cardAppId) {
  return request({
    url: `${pre}/get?cardAppId=${cardAppId}`,
    method: 'GET',
  });
}

// 门禁卡办卡记录回显
export function getApplyCardById(cardAppId) {
  return request({
    url: `${pre}/getCardHdldetail?cardAppId=${cardAppId}`,
    method: 'GET',
  });
}

// 门禁卡信息回显
export function getByappNo(appNo) {
  return request({
    url: `${pre}/getByappNo?appNo=${appNo}`,
    method: 'GET',
  });
}

// 门禁卡审批
export function submitNext(data) {
  return request({
    url: `${pre}/toNextNode`,
    method: "post",
    data,
  });
}

// 办理还卡功能
export function processCardReturn(data) {
  return request({
    url: `${pre}/editVisitorsCard`,
    method: "post",
    data,
  });
}


export function page(data) {
  return request({
    url: `${pre}/page`,
    method: "post",
    data: data
  });
}
